<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;

class CreateTagsTable extends Migration
{
    public function up()
    {
        Schema::create('tags', function (Blueprint $table) {
            $table->increments('id');

            $table->string('name');
            $table->string('slug');
            $table->string('catalogue')->default('')->comment('标签的目录名称');
            $table->boolean('recommend')->default(false)->comment('是否推荐');
            $table->string('seo_title')->default('')->comment('seo的标题');
            $table->string('seo_keywords')->default('')->comment('seo的关键词');
            $table->string('seo_description')->default('')->comment('seo的描述');

            $table->timestamps();

            $table->unique(['slug', 'catalogue']);
        });
    }

    public function down()
    {
        Schema::dropIfExists('tags');
    }
}
